// ==========================================================================
// GEA自动生成model扩展代码列表、增、删，改、查、导出，只生成一次，按需修改,再次生成不会覆盖.
// 生成日期：{{.table.CreateTime}}
// 生成路径: app/system/{{.table.ModuleName}}/internal/define/{{.table.BusinessName}}.go
// 生成人：{{.table.FunctionAuthor}}
// ==========================================================================
package define
import (
    "gea/app/model"
    "github.com/gogf/gf/os/gtime"
)

// ========== api =============

// {{.table.BusinessName | CamelString}}ApiSelectPageReq 分页请求参数 {{$pkColumn := .table.PkColumn}}
type {{.table.BusinessName | CamelString}}ApiSelectPageReq struct { {{range $index, $column := .table.Columns}} {{if eq $column.IsQuery "1"}}
     {{$column.GoField}}  {{if eq $column.GoType "Time"}}*gtime.Time{{else}}{{$column.GoType}}{{end}} `p:"{{$column.HtmlField}}"` //{{$column.ColumnComment}} {{end}} {{end}}
     PageNum     int     `p:"pageNum"`     //当前页码
     PageSize    int     `p:"pageSize"`   //每页数
     OrderByColumn string `p:"orderByColumn"` //排序字段
     IsAsc           string `p:"isAsc"`           //排序方式
}

// {{.table.BusinessName | CamelString}}ApiCreateReq 新增页面请求参数
type {{.table.BusinessName | CamelString}}ApiCreateReq struct { {{range $index, $column := .table.Columns}}
     {{if and (eq $column.IsInsert "1") (ne $column.IsPk "1")}} {{$column.GoField}}  {{if eq $column.GoType "Time"}}*gtime.Time{{else}}{{$column.GoType}}{{end}}   `p:"{{$column.HtmlField}}" {{if eq $column.IsRequired "1"}}v:"required#{{$column.ColumnComment}}不能为空"{{end}}` {{end}} {{end}}
}

// {{.table.BusinessName | CamelString}}ApiUpdateReq 修改页面请求参数
type {{.table.BusinessName | CamelString}}ApiUpdateReq struct {
     {{.table.PkColumn.GoField}}     {{.table.PkColumn.GoType}}  `p:"{{.table.PkColumn.HtmlField}}" v:"required#主键ID不能为空"`
     {{.table.BusinessName | CamelString}}ApiCreateReq
}

// {{.table.BusinessName | CamelString}}ApiDeleteReq 通用的删除请求
type {{.table.BusinessName | CamelString}}ApiDeleteReq struct {
     Ids string `p:"ids"  v:"required#请选择要删除的数据记录"`
}

// ======= service =========
// {{.table.BusinessName | CamelString}}ServiceList 查询列表返回值
type {{.table.BusinessName | CamelString}}ServiceList struct {
    List  []model.{{.table.TableName | CamelString}} `json:"list"`
    Page  int            `json:"page"`
    Size  int            `json:"size"`
    Total int            `json:"total"`
}